package com.neusoft.databus.policy.expression;

import java.util.Map;

import com.neusoft.databus.common.bean.ResourceBean;

/**
 * 策略解析器
 * 
 * @author naxiang
 */
public interface PolicyExpressionParser {

    /**
     * 指标比较
     * 
     * @param expression
     * @param resourceBean
     * @return
     * @throws Exception
     */
    public boolean valueCompare(Map<String, Object> expression, ResourceBean resourceBean) throws Exception;

    /**
     * 指标变化
     * 
     * @param expression
     * @param resourceBean
     * @param policyId
     * @return
     * @throws Exception
     */
    public boolean valueChange(Map<String, Object> expression, ResourceBean resourceBean, Long policyId)
            throws Exception;

    /**
     * 指标变化率
     * 
     * @param expression
     * @param resourceBean
     * @param pid
     * @return
     * @throws Exception
     */
    public boolean valuePercentageChange(Map<String, Object> expression, ResourceBean resourceBean, Long policyId)
            throws Exception;

    /**
     * 指标变化大小
     * 
     * @param expression
     * @param resourceBean
     * @param pid
     * @return
     * @throws Exception
     */
    public boolean valueScopeChange(Map<String, Object> expression, ResourceBean resourceBean, Long policyId)
            throws Exception;

    /**
     * 自定义公式
     * 
     * @param expression
     * @param resourceBean
     * @param pid
     * @return
     * @throws Exception
     */
    public boolean custom(Map<String, Object> expression, ResourceBean resourceBean, Long policyId) throws Exception;

}
